<?php

require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'config.php');
define('BIKE_ROOT', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
define('BIKE_INCLUDE_DIR', BIKE_ROOT . 'libs' . DIRECTORY_SEPARATOR);
define('BIKE_HTML_ROOT', BIKE_ROOT . 'html' . DIRECTORY_SEPARATOR);
define('BIKE_UPLOAD_DIR', BIKE_HTML_ROOT . 'uploads' . DIRECTORY_SEPARATOR);
define('BIKE_WEB_DIRECTORY_SEPARATOR','/');

header('Content-type: text/html; charset=utf-8');

function bike_autoload($className){
	$fileName = BIKE_INCLUDE_DIR . str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
	if(file_exists($fileName)){
		require $fileName;
	}
}

spl_autoload_register('bike_autoload');